package xin.alum.aim.groups;

import lombok.Data;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.cloud.context.config.annotation.RefreshScope;
import xin.alum.aim.constant.AIMConstant;

/**
 * @auther Alum(alum @ live.cn)
 * @date 2021/8/17 19:35
 */
@Data
@RefreshScope
@ConfigurationProperties(prefix = AIMConstant.CLUSTER_PROPERTIES_PREFIX)
public class ClusterProperties {
    /**
     * 集群模式,默认未开启
     */
    private ClusterMode mode = ClusterMode.None;

    /**
     * 集群模式
     */
    public enum ClusterMode {
        None("none", 0),
        Redis("redis", 1),
        RabbitMq("rabbitmq", 2);

        private String name;
        private int value;

        ClusterMode(String name, int value) {
            this.name = name;
            this.value = value;
        }
    }
}
